On the PC, several DOS based X10 utility packages are available. X10Utils is among the most useful of these. It consists of a series of executable modules with a command line interface. It therefore can be interfaced in complex ways to other software such as BBS software or voicemail packages like BigMouth.
With BBS software, the X10 commands can be executed on demand via Doors, or as Events occurring at regular times of the day. Since the BigMouth voicemail package has a feature which allows for the execution of commands based on touch tone input, a script called from BigMouth could also be used alongside X10UTILS to create an integrated voicemail/X10 system.
The X10UTILS include X10DIR (which sends a single X10 command to a selected module); X10DNLD (which executes a series of X10 commands placed in a file), X10EVENT (which downloads a single X10 Event to the CP290), X10MON (which monitors events as they occur), X10UPLD (which uploads the event file from the CP290), and X10TIME (which uploads or downloads the time to the CP290).
Ideas for using X-10
The X-10 system is designed so that each module has its own processor and memory. This means that the modules do not require a computer to operate. For example, the home security systems are completely self sufficient, and can be used just like appliances.
Nevertheless, if you have a computer, you can do some neat things. The CP290 interface kit allows your Macintosh to send events to any X-10 device that operates over electric wiring. Since the CP290 contains its own non-volatile memory, it can store events to be sent at particular times during the week.
You could program the CP290 to turn on your coffee machine at 8:00 AM on weekdays, and automatically turn it off at 9:30 AM, in case you forgot to do so yourself. You could wake up by having your TV or Stereo go on.
I once lived in a house that did not have adequate heating. I had to purchase two space heaters, and an electric blanket. Since the house wiring was limited, I couldn't have two heaters on at the same time. Also, in order to keep my electric bill down, I didn't want to leave the heaters and electric blanket on all night.
Given these constraints, my desire was to make sure that both my bedroom and bathroom were warm when I got up in the morning. I also liked the idea of crawling into a warm bed.
To accomplish this, I programmed the CP290 to turn the two heaters on and off at 15 minute intervals from 5:00 AM to 6:00 AM, during the weekdays, when I usually got up. Only one heater was on at a time. Both heaters went off at 8:00 AM, when I would usually leave for work. On weekends, the heaters went on and off from 8:00 AM to 9:00 AM.
On weekdays, the heaters went back on and off from 6:00 PM to 7:00 PM. That way, when I got home around 7:00 PM, the house would be warm. The electric blanket went on around 9:00 PM and went off around 11:00 PM.
As strange as this program might sound, it worked well for me for almost two years, until I moved to an apartment with a functioning heating system.
More advanced ideas
Although X-10 is not designed to allow transmission of measurements over the network, such as temperatures, light levels, or humidities, you can compensate for these failings by purchasing additional hardware. For example, if you were to purchase a Radiant Common Sense module, you could then take measurements of parameters such as temperature, humidity, etc. and then send X-10 events to appliances in response to the measurements. For example, if it was after midnight, and the temperature was over 32 degrees, you could send an X-10 command to the thermostat module to turn down the heat. However, as sunrise approached, you could let the thermostat setting return to normal. The way this works is the thermostat module is mounted just below the actual thermostat. It contains a small heating element to fool the thermostat. X-10 modules are also capable of turning relays on and off, and closing draperies, among other things.
So even though your thermostat cannot respond to temperature information directly, it can nevertheless be controlled via X-10. The Radiant Common Sense module, which can take in 8 channels of A/D, and D/A, and drive relays, adds enormous power to the home (and industrial) applications that can be addressed. Equivalent cards are also available for the PC for less than $200.
The forthcoming release of AppleScript brings to mind some interesting possibilities. The CP290 does not allow you to monitor events sent over the electric wiring. To do this, you need the TW523 Two-Way Power Line Interface. With the TW523, you can have your Mac intercept X-10 events sent over electrical wiring , and send other events to respond to these. Unfortunately, there is not an equivalent to the TW523 for events sent over the airwaves, like those sent by the window and motion sensors.
With AppleEvent-aware CP290 software, and other applications that can interpret AppleEvents, much more powerful X-10 applications would be possible. While X-10 currently offers a telephone responder, it is not possible to use the responder and an answering machine on the same line. With AppleEvents it would be possible to have a voice mail system such as the TFLX send events to your appliances, depending on which key you pressed on your touch tone phone. This would allow you to call in and turn things on and off without having to use up an extra phone line, like the telephone responder module does.
X-10 Scripts (Doing a Little DOS)
Since the concepts behind X-10, Radiant, CEBus, and EcheLON are inherently object oriented, in order to take full advantage of all this, you've got to have a meta-language capable of handling and creating events. Since we don't have AppleScript yet, I'll have to illustrate this point with examples from DOS batch scripts, to give you an idea of what you'll soon be able to do.
Under DOS, voice mail systems such as BigMouth can shell out to a batch file or program of your choice if a certain series of touch tones is received. BBS software such as OPUS can generate events (ERRORLEVELS in DOS) which DOS batch scripts can trap and respond to.
Since lots of DOS programs can operate from the command line, it is easy to respond to these events by sending X-10 events or FAXes, transmitting messages over the phone, calling out by modem, etc.
To give you an idea of how this works on the PC, I’ve written a batch script. This script makes use of the OPUS BBS software to generate events at various error levels at preselected times of the day. Other software like BigMouth could also be used; however in this case you’d need to generate your own events based for example, on the time of day. In the case of OPUS, event times and error levels are set within the software. The batch script then responds to these events by doing various things. X10DIR is a program to send an X-10 event to a particular module; STALL is a program that waits a specified amount of time (in seconds), and CCOMSEND is a program that will send a FAX. Here is the script:
:LOOP
OPUS BBS -O
IF ERRORLEVEL 50 GOTO HEATERON
IF ERRORLEVEL 40 GOTO HEATEROFF
IF ERRORLEVEL 30 GOTO LIGHTSON
IF ERRORLEVEL 25 GOTO BREAKIN
IF ERRORLEVEL 20 GOTO DINNER
IF ERRORLEVEL 10 GOTO LUNCH
GOTO LOOP
:HEATERON
REM Turn on the space heater
X10DIR A2 ON
GOTO LOOP
:HEATEROFF
REM Turn off the space heater
X10DIR A2 OFF
GOTO LOOP
:LIGHTSON
X10DIR A1 ON
GOTO LOOP
:BREAKIN
REM Turn on all the lights
X10DIR A2 ON
X10DIR A3 ON
REM Send a FAX to the BMUG Office via the
REM Complete Communicator board
CCOMSEND BREAKIN.TXT 849-9026 /x
REM GO INTO LOOP TURNING LIGHTS ON AND OFF
:FLASH
X10DIR A2 ON
X10DIR A3 ON
STALL 1
X10DIR A2 OFF
X10DIR A3 OFF
GOTO LOOP
:DINNER
REM TURN OFF TV IN CHILDREN'S ROOM
X10DIR A5 OFF
GOTO LOOP
:LUNCH
REM REMIND ME BY FLASHING MY DESK LAMP
X10DIR A6 ON
STALL 1
X10DIR A6 OFF
STALL 1
X10DIR A6 ON
GOTO LOOP
While writing such a script is easy for DOS, it is much more difficult to do on the Macintosh prior to the release of AppleScript. While it is theoretically possible to do all of this under HyperCard, in practice few manufacturers of FAX hardware, etc. support control of their hardware by XCMDs. There are also no XCMDs for control of X-10 devices although these are not hard to write.
However, when we get AppleEvent-aware applications that can listen for home control events and send appropriate AppleEvents to other applications to send FAXes, dial out, etc. we will have the basic tools to make all of this work.
Hooking it all to your phone
Talking Technology, Inc. offers the BigMouth (single-line) and PowerLine (two line) voicemail board. These cards are easily programmed using the software that comes with the board, or alternatively, the developer’s toolkit or SpeakEasy interpreted development language.
To give you an idea of how powerful BigMouth is, it was possible to develop a Fax-back system (a system that will allow a caller to input the phone number of his fax machine, and receive a fax on it after hanging up) with only 15 lines of DOS batch script.
Here’s how the system works:
1. Bigmouth is executed within an “event loop” by the batch script RUNBIG.BAT.
RUNBIG.BAT listing
C:
REM Load the Complete Communicator Background code
REM
CCBACK /N
REM
REM Go into the Bigmouth directory
REM
CD \BIGMOUTH
REM
REM Begin the event loop
REM
:LOOP
REM
REM Enter BigMouth and wait for incoming calls
REM
BIGMOUTH W
REM
REM We get here if BigMouth has exited on a FaxBack Event
REM Extract phone number entered from the Bigmouth Log
REM
AWK -f FAX.AWK BIGMOUTH.LOG >FAX.BAT
REM
REM Save the log to another file, and then delete it
REM
COPY BIGM.LOG + BIGMOUTH.LOG BIGM.LOG
DEL BIGMOUTH.LOG
REM
REM Execute the batch script prepared by awk
REM
CALL FAX
REM
REM Handle more events
REM
GOTO LOOP
2. BigMouth is programmed to exit to DOS after playing a message tell the caller what to do, and recording theuth is programmed to exit to DOS after playing a message tell the caller what to do, and recording the phone number entered as touch tones in its logfile, BIGMOUTH.LOG. the particular document selected by the caller to be faxed to them. This was selected (again by touchtone input) before a phone number was requested.
3. The utility awk is used to extract the phone number (the last field) and output the batch script FAX.BAT which is then executed. Here is the awk program to do this:
FAX.AWK listing
/UPDATE1 /{print “CCOMSEND UPDATE1.DOC”,$5}
/UPDATE2 /{print “CCOMSEND UPDATE2.DOC”,$5}
/UPDATE3 /{print “CCOMSEND UPDATE3.DOC”,$5}
/UPDATE4 /{print “CCOMSEND UPDATE4.DOC”,$5}
Here the stuff between the slashes is the stuff that awk is to look for. Once it finds it, it is to execute the command after the slashes. This is printing out a line in the batch script telling CCOM (the Complete Communicator board) to queue up a Fax for the phone number entered in the Bigmouth.log file. Since the phone number is the fifth field in the log entry (as separated by spaces, commas, etc.), it is output as $5.
The total amount of programming here is less than 25 lines of code in awk and DOS batch script. The result however, is a Faxback system which is the equal of systems costing over $1000 for a total hardware cost of under $400.
The thing to keep in mind is that this particular approach could work just as well for controlling your home. For example, instead of executing CCOMSEND (the CCOM Fax spooling routine), we could have executed X10DIR in order to turn a particular light, heater, or applicance on or off.
Home control movers and shakers
Radiant
Radiant Enterprises, Inc., 1714 Stockton Street, San Francisco, CA 94133, (415)296-8040, Fax: (415)362-3528
The Common Sense AppleTalk Sense and Control Node offers 8 programmable digital input/outputs, 4 analog inputs, 4 power relay outputs, and comes with Macintosh applications software to allow control of any of the functions over AppleTalk.
Radiant Enterprises, Inc., 1714 Stockton Street, San Francisco, CA 94133, (415)296-8040, (415)362-2528.
PowerSwitch LT $139
The PowerSwitch LT is a programmable power supply controllable over AppleTalk. It can be programmed to turn off or on anything plugged into it. Once programmed, events remain in the parameter RAM, able to execute without further instruction from a computer. The PowerSwitch can be turned on and off from the Chooser, or it can be left in Auto mode, in which case it will sense AppleTalk network Name Binding Protocol (NBP) lookups to the device it is controlling. In this mode it could be used to turn off a LaserWriter after an hour of inactivity, and power it on again when a user prints to it. Since laser printers draw power (and lots of it!) even when they aren't doing anything, PowerSwitch LT's typically pay for themselves in saved electricity.
Radiant Enterprises, Inc., 1714 Stockton Street, San Francisco, CA 94133, (415)296-8040, (415)362-2528.
X10 Products
Catalogs, Books and Associations
How to Automate Your Home $29.95
If this article piqued your interest, then you might want to check this out. The book is an overview of different types of home automation, from security to energy saving devices.
Home Automation, USA, P.O. Box 22536, Oklahoma City, OK 73123, (405)842-3419, FAX: (405)842-3419
Home Automation by Heath
This is a catalog of Heath products for home automation that concentrates mainly on X-10 technology.
If you're interested in home control, and want a complete catalog of X-10 products, you can get it from Home Automation Laboratories, of Atlanta, Georgia. They've got stuff in there you wouldn't believe, like an automatic indoor plant watering system, developed by NASA. They offer a 30 day money back guarantee, and guarantee the lowest prices on everything.
Home Automation Laboratories, 5500 Highlands Parkway, Suite 450, Atlanta, GA 30082; (404)319-6000; (800)445-9605; FAX: (404)438-2835.
Home Automation Association
If you are in the Home Automation business, you may wish to join the Home Automation Association, which sponsors various trade shows and seminars.
An Installer's Guide to CEBus Home Automation $149
For those in the construction business, Parks Associates sells an installer's guide to the CEBUS, which gives you an idea of what can be done. Be aware that the specs are not done yet, so quite a bit of any such material will be speculative.
Parks Associates, (214)490-1113, FAX:(214)490-1133
Software
X10Utils Shareware $10
This set of utilities allows you build a flexible and powerful home control network, stringing the individual utilities together into an event loop using DOS batch script.
EXEC-PC,P.O. Box 57, Elm Grove, WI 53122, (414)789-4200 (Voice), (414)789-4210 (data)
Tom Salzman, 1008 Castalia Drive, Cary, NC 27513;
email: tom@ramona.Cary.NC.US; BBS: (919)481-3787, logon as userid X10 with password X10).
X-10 TW523 Developer's Kit
This kit is for IBM PC developers, but with a bunch of phone calls, they might be persuaded to port the code to Think C. Code is provided in Microsoft or Turbo C.
Baran-Harper Group, Toronto, CA (416)294-6473; FAX:(416)471-6776
Computer Interface Kits
Model CP290
X-10 Macintosh interface Kit $49.95
PC interface Kit $49.95
The CP290 controller is capable of remembering events which are to be triggered at times during the week. The software that comes with the CP290 kit allows you to set up events and download them to the CP290. You can also send the CP290 commands in real time. Based on these commands, it sends out events to the X-10 appliance modules. The CP290 is only capable of sending events; it cannot receive X-10 events.
This unit allows you to control up to 10 items from your touch tone phone. The problem is, it isn't compatible with your answering machine, so you need a line just for it. Yuck!
MasterVoice Personal Butler
This unit combines timer control, touch control,a motion sensor, and voice control into a single unit. Can control up to 6 total devices on X-10.
MasterVoice, (213)594-6581.
X-10 Model IR543
Infrared Gateway/Controller
This unit receives infrared signals and then retransmits them over the house wiring. However, it doesn't work the other way, since it can't listen for X-10 signals.
X-10 Model PL513
Power Line Interface
This unit allows a device designed to send X-10 events (typically created by O.E.Ms) to do so without having to couple to the power line.
X-10 Model TW523 $24.95
Two-Way Power Line Interface
This unit allows a device to send as well as receive X-10 events without having to couple to the power line. For example, it could be used to connect your Macintosh to the X-10 system.
Control Modules
X-10 Model RC5000
Remote Controlled Security System $39.95
This allows you to manually control up to 16 devices (2 banks of 8 devices) remotely. You can turn your lights on or off, etc.
X-10 Model MC460
Mini Controller $10.95
This unit can control up to 8 modules from outside the home (2 banks of 4).
Sensor Modules (Can Send Events Only)
X-10 Model MT522
Timer Module and Clock $29.95
This module can send events by itself according to time of day, without having to be programmed by computer. It also has a clock on it.
X-10 Model SD533
Sun Downer $19.95
This is an MC460 with a built in photocell to turn off up to 4 devices at a time. It can control up to 8 devices (2 banks of 4)
Appliance Modules (Can Receive Events Only)
X-10 Model UM506
Universal Module $18.95
This module activates a relay, and so can be used to turn on sprinklers, open or close drapes, or turn on or off thermostats.
X-10 Model TH2807
Thermostat controller $19.95
This device receives events, and is placed underneath a thermostat in order to turn it on or off.
X-10 Model AM466
Appliance Module $14.95
This module can turn on or off an appliance.
X-10 Model WS467
Wall Dimmer Module $14.95
This module replaces a wall switch, and is capable of receiving dimming commands in addition to on or off.
X-10 Model SR227
Split Receptacle $19.95
This module replaces your wall outlet, and can receive on or off events.
X-10 Model LM 465
Lamp Module $12.95
This is an external module that plugs into your wall, and can receiving dimming commands in addition to on or off events. This module should not be used with major appliances, since it isn't made to handle the current.
X-10 Model WS477
3 Way Wall dimmer $19.95
Home Security Modules (Send Events Only)
X-10 Model DW534
Wireless Door/Window Sensor $14.99
This module sends an event if two magnets become separated.
X-10 Model HT544
Remote Control $19.95
This module can arm or disarm the home security system.
X-10 Model KF574
Miniature Remote Control $19.95
A miniature version of the HT544, small enough to place on a key chain. Can operate with the SS5400 security system.
X-10 Model PH508
Power Line Siren $49.95
This little baby can put out 105 decibels when sent an event by a motion sensor or window sensor.
BigMouth is a highly programmable voicemail card for IBM PC compatibles. Since a developer’s kit and an interpreted development language (SpeakEasy) is available, many third party applications have been written for this card, and its two-line brother, PowerLine. Since it does not have a processor onboard, it requires a dedicated computer. This and the large third party application base make it most popular in business environments. However, BigMouth also has a built in Alarm jack that will automatically dial out if your alarm system is tripped. Be aware that version 3.0 of BigMouth is buggy and less stable than version 2.1. I purchased the upgrade, but have never been able to use it due to a myriad of problems.
The Complete Communicator combines a voicemail card, modem, and fax all on one board, while the Complete Fax is just a Fax board. Most importantly for the discussion in this chapter, these boards have a processor on them, so that they can run in the background. Even though they are both voicemail cards, the Complete Communicator will not conflict with the BigMouth provided that one of the boards is set to an address other than 3E0 (which is the default for both boards), and the BigMouth is set to pick up on one ring, while the Communicator is set to pick up on 2 or more rings. The Complete Communicator (or Complete Fax) can deliver an outgoing Fax spooled to the Fax Queue while BigMouth is running in the foreground.
The Complete PC, Inc., 1983 Concourse Drive, San Jose, CA 95131, (408)434-0145.